#include "QCam.h"

QCam::QCam() {
	cap = NULL;
};

QCam::~QCam() {
	closeCam();
}

CvCapture* QCam::openCam(int index) {
	if (NULL == cap) {
		cap = cvCaptureFromCAM(index);
	}
    return cap;
}

void QCam::closeCam() {
	if (cap) {
		cvReleaseCapture( &cap );
	}
	cap = NULL;
    return;
}

IplImage* QCam::getImage() {
    return NULL;
}

IplImage* QCam::getFrame() {
    return NULL;
}
